/*
 * @Author: your name
 * @Date: 2021-07-23 20:25:08
 * @LastEditTime: 2021-07-23 21:35:58
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Self\hm-news-86\src\store\module\user.js
 */
/* 用户模块的vuex操作 */

import { setStorageToken, getStorageToken } from '@/utils/storage'

export default {
  namespaced: true,
  state: {
    token: getStorageToken()
  },
  mutations: {
    setToken(state, payload) {
      state.token = payload

      // 把token数据给本地存储起来
      setStorageToken(payload)
    }
  },
  actions: {},
  modules: {}
}
